//
//  shipDetailCell.m
//  WHB_driver
//
//  Created by 徐国庆 on 15/12/25.
//  Copyright (c) 2015年 turing. All rights reserved.
//

#import "shipDetailCell.h"

@implementation shipDetailCell

- (void)awakeFromNib {
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //上方空白
        self.topLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.topLabel];
        
        //货单号
        self.shipListNumberLabel = [[UILabel alloc] init];
        self.shipListNumberLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.shipListNumberLabel];
        
        //货单状态
        self.stateLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.stateLabel];
        self.stateLabel.font = [UIFont systemFontOfSize:15];
        self.stateLabel.textAlignment = NSTextAlignmentRight;
        
        // 线1
        self.line1 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line1];
        
        //出发地
        self.setoutAddressLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.setoutAddressLabel];
        
        //地址指向图标
        self.addressImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.addressImageView];
        
        //目的地
        self.aimAddressLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.aimAddressLabel];
        
        //介质图标
        self.mediumImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.mediumImageView];
        
        //介质内容
        self.mediumLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.mediumLabel];
        
        //重量图标
        self.weightImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.weightImageView];
        
        //重量
        self.weightLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.weightLabel];
        
        // 接收货物完成
        self.receiveShipOverButton = [UIButton buttonWithType:UIButtonTypeCustom];
//        [self.contentView addSubview:self.receiveShipOverButton];
        [self.receiveShipOverButton setTitle:@"取货完成" forState:UIControlStateNormal];
        self.receiveShipOverButton.layer.masksToBounds = YES;
        self.receiveShipOverButton.layer.cornerRadius = 15;
        
        // 线2
        self.line2 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line2];
        
        
        //备注
        self.remarkLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.remarkLabel];
        
        //备注内容
        self.remarkContentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.remarkContentLabel];
        self.remarkContentLabel.textAlignment = 2;
        
        //上方空白2
        self.topLabel2 = [[UILabel alloc] init];
        [self.contentView addSubview:self.topLabel2];
        
        //收货方
        self.receiveBusinessLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.receiveBusinessLabel];
        
        //收货方内容
        self.receiveContentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.receiveContentLabel];
        self.receiveContentLabel.textAlignment = 2;
        
        //是否认证图标
        self.identificationImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.identificationImageView];
        
        // 拨打电话
        self.callingButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:self.callingButton];
        [self.callingButton setTitle:@"拨打电话" forState:UIControlStateNormal];
        self.callingButton.layer.masksToBounds = YES;
        self.callingButton.layer.cornerRadius = 15;

        // 线3
        self.line3 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line3];
        
        
        //收货方
        self.getBusinessLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.getBusinessLabel];
        
        //收货方内容
        self.getContentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.getContentLabel];
        self.getContentLabel.textAlignment = 2;
        
        //是否认证图标
        self.identificationGetImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.identificationGetImageView];
        
        // 拨打电话
        self.callingGetButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:self.callingGetButton];
        [self.callingGetButton setTitle:@"拨打电话" forState:UIControlStateNormal];
        self.callingGetButton.layer.masksToBounds = YES;
        self.callingGetButton.layer.cornerRadius = 15;

        //上方空白3
        self.topLabel3 = [[UILabel alloc] init];
        [self.contentView addSubview:self.topLabel3];
        
       
        //货单号
        self.numberLabel = [[UILabel alloc] init];
        self.numberLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.numberLabel];
        
        //货单状态
        self.numberStateLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.numberStateLabel];
        self.numberStateLabel.font = [UIFont systemFontOfSize:15];
        self.numberStateLabel.textAlignment = NSTextAlignmentRight;
        
        // 线4
        self.line4 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line4];
        
        //货单号
        self.dateLabel = [[UILabel alloc] init];
        self.dateLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.dateLabel];
        
        //货单状态
        self.dateStateLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.dateStateLabel];
        self.dateStateLabel.font = [UIFont systemFontOfSize:15];
        self.dateStateLabel.textAlignment = NSTextAlignmentRight;
        
        // 线5
        self.line5 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line5];
        
        //货单号
        self.receiveTureLabel = [[UILabel alloc] init];
        self.receiveTureLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.receiveTureLabel];
        
        //货单状态
        self.receiveTureContentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.receiveTureContentLabel];
        self.receiveTureContentLabel.font = [UIFont systemFontOfSize:15];
        self.receiveTureContentLabel.textAlignment = NSTextAlignmentRight;
        
        // 线6
        self.line6 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line6];
        
        
        //货单号
        self.sendLabel = [[UILabel alloc] init];
        self.sendLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.sendLabel];
        
        //货单状态
        self.sendContentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.sendContentLabel];
        self.sendContentLabel.font = [UIFont systemFontOfSize:15];
        self.sendContentLabel.textAlignment = NSTextAlignmentRight;
        
        // 线7
        self.line7 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line7];
        
       
        //货单号
        self.qianshouLabel = [[UILabel alloc] init];
        self.qianshouLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.qianshouLabel];
        
        //货单状态
        self.qianshouContentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.qianshouContentLabel];
        self.qianshouContentLabel.font = [UIFont systemFontOfSize:15];
        self.qianshouContentLabel.textAlignment = NSTextAlignmentRight;
        
        // 线8
        self.line8 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line8];
        
        
        //货单号
        self.driverLabel = [[UILabel alloc] init];
        self.driverLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.driverLabel];
        
        //货单状态
        self.driverContentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.driverContentLabel];
        self.driverContentLabel.font = [UIFont systemFontOfSize:15];
        self.driverContentLabel.textAlignment = NSTextAlignmentRight;
        
        // 线9
        self.line9 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line9];
        
        //货单号
        self.shipMasterLabel = [[UILabel alloc] init];
        self.shipMasterLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.shipMasterLabel];
        
        //货单状态
        self.shipMasterContentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.shipMasterContentLabel];
        self.shipMasterContentLabel.font = [UIFont systemFontOfSize:15];
        self.shipMasterContentLabel.textAlignment = NSTextAlignmentRight;
        
        // 线9
        self.line10 = [[UILabel alloc] init];
        [self.contentView addSubview:self.line10];
        
       
        
    }
    return self;
}

- (void)layoutSubviews{
    
    self.topLabel.frame = CGRectMake(0, 0, self.frame.size.width, 10);
    self.shipListNumberLabel.frame = CGRectMake(10, 10, 300, 40);
    self.stateLabel.frame = CGRectMake(self.frame.size.width - 100, self.shipListNumberLabel.frame.origin.y, 80, 40);
    self.line1.frame = CGRectMake(0, CGRectGetMaxY(self.stateLabel.frame), self.frame.size.width, 0.5);
    self.setoutAddressLabel.frame = CGRectMake(10, CGRectGetMaxY(self.line1.frame), 50, 40);
    self.addressImageView.frame = CGRectMake(CGRectGetMaxX(self.setoutAddressLabel.frame) - 5, self.setoutAddressLabel.frame.origin.y + 15, 25, 14);
    self.aimAddressLabel.frame = CGRectMake(CGRectGetMaxX(self.addressImageView.frame), self.setoutAddressLabel.frame.origin.y, 50, 40);
    
    self.mediumImageView.frame = CGRectMake(10, CGRectGetMaxY(self.setoutAddressLabel.frame) + 0.5, 16, 16);
    self.mediumLabel.frame = CGRectMake(CGRectGetMaxX(self.mediumImageView.frame) + 3, self.mediumImageView.frame.origin.y - 8, 50, 30);
    self.weightImageView.frame = CGRectMake(CGRectGetMaxX(self.mediumLabel.frame), self.mediumImageView.frame.origin.y, 16, 16);
    self.weightLabel.frame = CGRectMake(CGRectGetMaxX(self.weightImageView.frame) + 3, self.weightImageView.frame.origin.y - 8, 50, 30);
    self.receiveShipOverButton.frame = CGRectMake(self.frame.size.width - 150, CGRectGetMaxY(self.line1.frame) + 20, 130, 30);
    self.line2.frame = CGRectMake(10, CGRectGetMaxY(self.mediumLabel.frame), self.frame.size.width - 20, 0.5);
    
    self.remarkLabel.frame = CGRectMake(10, CGRectGetMaxY(self.line2.frame) + 0.5, 70, 40);
    self.remarkContentLabel.frame  = CGRectMake(CGRectGetMaxX(self.remarkLabel.frame) + 20, self.remarkLabel.frame.origin.y, self.frame.size.width - CGRectGetMaxX(self.remarkLabel.frame) - 40, 40);
    self.topLabel2.frame = CGRectMake(0, CGRectGetMaxY(self.remarkLabel.frame), self.frame.size.width, 10);
    
    self.receiveBusinessLabel.frame = CGRectMake(10, CGRectGetMaxY(self.topLabel2.frame) + 0.5, 100, 30);
    self.receiveContentLabel.frame = CGRectMake(self.frame.size.width - 150, self.receiveBusinessLabel.frame.origin.y, 100, 30);
    self.identificationImageView.frame = CGRectMake(self.frame.size.width - 30, self.receiveBusinessLabel.frame.origin.y + 8, 13, 13);
    self.callingButton.frame = CGRectMake(self.frame.size.width - 150, CGRectGetMaxY(self.receiveContentLabel.frame), 130, 30);
    self.line3.frame = CGRectMake(10, CGRectGetMaxY(self.callingButton.frame) + 10, self.frame.size.width - 20, 0.5);
    
    self.getBusinessLabel.frame = CGRectMake(10, CGRectGetMaxY(self.line3.frame) + 0.5, 100, 30);
    self.getContentLabel.frame = CGRectMake(self.frame.size.width - 150, self.getBusinessLabel.frame.origin.y, 100, 30);
    self.identificationGetImageView.frame = CGRectMake(self.frame.size.width - 30, self.getBusinessLabel.frame.origin.y + 8, 13, 13);
    self.callingGetButton.frame = CGRectMake(self.frame.size.width - 150, CGRectGetMaxY(self.getContentLabel.frame), 130, 30);
   self.topLabel3.frame = CGRectMake(0, CGRectGetMaxY(self.callingGetButton.frame) + 10, self.frame.size.width, 10);
    
    self.numberLabel.frame = CGRectMake(10, CGRectGetMaxY(self.topLabel3.frame), 200, 40);
    self.numberStateLabel.frame = CGRectMake(self.frame.size.width - 200, self.numberLabel.frame.origin.y, 180, 40);
    self.line4.frame = CGRectMake(0, CGRectGetMaxY(self.numberLabel.frame), self.frame.size.width, 0.5);

    self.dateLabel.frame = CGRectMake(10, CGRectGetMaxY(self.line4.frame), 200, 40);
    self.dateStateLabel.frame = CGRectMake(self.frame.size.width - 200, self.dateLabel.frame.origin.y, 180, 40);
    self.line5.frame = CGRectMake(0, CGRectGetMaxY(self.dateLabel.frame), self.frame.size.width, 0.5);
    
    self.receiveTureLabel.frame = CGRectMake(10, CGRectGetMaxY(self.line5.frame), 200, 40);
    self.receiveTureContentLabel.frame = CGRectMake(self.frame.size.width - 200, self.receiveTureLabel.frame.origin.y, 180, 40);
    self.line6.frame = CGRectMake(0, CGRectGetMaxY(self.receiveTureLabel.frame), self.frame.size.width, 0.5);
    
    
    self.sendLabel.frame = CGRectMake(10, CGRectGetMaxY(self.line6.frame), 200, 40);
    self.sendContentLabel.frame = CGRectMake(self.frame.size.width - 200, self.sendLabel.frame.origin.y, 180, 40);
    self.line7.frame = CGRectMake(0, CGRectGetMaxY(self.sendLabel.frame), self.frame.size.width, 0.5);
    
    self.qianshouLabel.frame = CGRectMake(10, CGRectGetMaxY(self.line7.frame), 200, 40);
    self.qianshouContentLabel.frame = CGRectMake(self.frame.size.width - 200, self.qianshouLabel.frame.origin.y, 180, 40);
    self.line8.frame = CGRectMake(0, CGRectGetMaxY(self.qianshouLabel.frame), self.frame.size.width, 0.5);
    
    self.driverLabel.frame = CGRectMake(10, CGRectGetMaxY(self.line8.frame), 200, 40);
    self.driverContentLabel.frame = CGRectMake(self.frame.size.width - 200, self.driverLabel.frame.origin.y, 180, 40);
    self.line9.frame = CGRectMake(0, CGRectGetMaxY(self.driverLabel.frame), self.frame.size.width, 0.5);
    
    self.shipMasterLabel.frame = CGRectMake(10, CGRectGetMaxY(self.line9.frame), 200, 40);
    self.shipMasterContentLabel.frame = CGRectMake(self.frame.size.width - 200, self.shipMasterLabel.frame.origin.y, 180, 40);
    self.line10.frame = CGRectMake(0, CGRectGetMaxY(self.shipMasterLabel.frame), self.frame.size.width, 0.5);
    
   

    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
